import { useState } from "react";
import { BrowserRouter, Link } from "react-router-dom";
import { ConfigProvider, Input, Button } from "antd";

import qiankunActions from "./action";
import "./App.css";
import styles from "./App.module.less";
import zhCN from "antd/locale/zh_CN";

function App() {
  // const nav = useNavigate();
  // const nav = () => {};
  const [bandwidth, setBandwidth] = useState(90);
  return (
    <div className={styles.App}>
      <BrowserRouter>
        <ConfigProvider locale={zhCN}>
          <div>
            {/* <Button
                type="primary"
                onClick={() => {
                  nav("/qqMusic");
                }}
              >
                去QQ音乐子应用
              </Button>
              <Button
                type="primary"
                onClick={() => {
                  nav("/neteaseMusic");
                }}
              >
                去网易云音乐子应用
              </Button> */}
            <Link to="" style={{ marginRight: "10px" }}>
              去主页
            </Link>

            <Link to="/qqMusic" style={{ marginRight: "10px" }}>
              去QQ音乐子应用
            </Link>

            <Link to="/neteaseMusic" style={{ marginRight: "10px" }}>
              去网易云音乐子应用
            </Link>
            <div style={{ display: "inline-block", width: "180px" }}>
              <Input
                value={bandwidth}
                onChange={(e) => {
                  setBandwidth(e.target.value);
                }}
              />
            </div>
            <Button
              onClick={() => {
                const temp = qiankunActions;
                qiankunActions.setGlobalState();
              }}
            >
              updateFrequency
            </Button>
          </div>
        </ConfigProvider>
      </BrowserRouter>
      <div id="container"></div>
    </div>
  );
}

export default App;
